gusucode.com > 智睿政府网站管理系统 V2.1.0 > 智睿政府网站管理系统 V2.1.0\code\Include\Southidcmenu.asp
<% '================================================== '过程名:MenuJS '作 用:生成下拉菜单相关的JS代码 '参 数:无 '================================================== sub MenuJS() response.write "<script type='text/javascript' language='JavaScript1.2' src='Include/Southidcmenu.js'></script>" end sub pNum=1 pNum2=0 '================================================= '过程名:ShowRootClass_Menu '作 用:显示一级栏目(下拉菜单效果) '参 数:无 '================================================= sub ShowRootClass_Menu() response.write "<script type='text/javascript' language='JavaScript1.2'>" & vbcrlf & "<!--" & vbcrlf response.write "stm_bm(['uueoehr',400,'','images/blank.gif',0,'','',0,0,0,0,0,1,0,0]);" & vbcrlf response.write "stm_bp('p0',[0,4,0,0,2,2,0,0,100,'',-2,'',-2,90,0,0,'#000000','transparent','',3,0,0,'#000000']);" & vbcrlf response.write "stm_ai('p0i0',[0,'','','',-1,-1,0,'','_self','','','','',0,0,0,'','',0,0,0,0,1,'#f1f2ee',1,'#cccccc',1,'','',3,3,0,0,'#fffffF','#000000','#000000','#000000','9pt 宋体','9pt 宋体',0,0]);" & vbcrlf response.write "stm_aix('p0i1','p0i0',[0,'<strong> 网站首页</strong>','','',-1,-1,0,'index.asp ','_self','index.asp','','','',0,0,0,'','',0,0,0,0,1,'#f1f2ee',1,'#cccccc',1,'','',3,3,0,0,'#fffff7','#FFFFFF','#FFFFFF','#CCCCCC','9pt 宋体','9pt 宋体 ']);" & vbcrlf response.write "stm_aix('p0i2','p0i0',[0,'','','',-1,-1,0,'','_self','','','','',0,0,0,'','',0,0,0,0,1,'#f1f2ee',1,'#cccccc',1,'','',3,3,0,0,'#fffff7','#000000','#000000','#000000','9pt 宋体','9pt 宋体',0,0]);" & vbcrlf dim sql,rs,j sql="select ClassID,ClassName,Depth,NextID,LinkUrl,Child,Readme From zhi_rui_g_MenuClass" sql= sql & " where Depth=0 and ShowOnTop="&TrueType&" order by RootID" Set rs= Server.CreateObject("ADODB.Recordset") rs.open sql,conn,1,1 if not(rs.bof and rs.eof) then j=3 do while not rs.eof if rs(4)<>"" then '此排显示是导航的字体,默认是白色 response.write "stm_aix('p0i"&j&"','p0i0',[1,'<strong>" & rs(1) & " </strong>','','',-1,-1,0,'" & rs(4) & "','_self','" & rs(4) & "','" & rs(6) & "','','',0,0,0,'','',0,0,0,0,1,'#f1f2ee',1,'#cccccc',1,'','',3,3,0,0,'#fffff7','#FFFFFF','#ffffff','#CCCCCC','9pt 宋体','9pt 宋体']);" & vbcrlf end if if rs(5)>0 then call GetClassMenu(rs(0),0) end if j=j+1 response.write "stm_aix('p0i2','p0i0',[0,'','','',-1,-1,0,'','_self','','','','',0,0,0,'','',0,0,0,0,1,'#f1f2ee',1,'#cccccc',1,'','',3,3,0,0,'#fffff7','#ffffff','#ffffff','#ffffff','9pt 宋体','9pt 宋体',0,0]);" & vbcrlf j=j+1 rs.movenext loop end if rs.close set rs=nothing response.write "stm_em();" & vbcrlf response.write "//-->" & vbcrlf & "</script>" & vbcrlf end sub sub GetClassMenu(ID,ShowType) dim sql,rs,k '1,4,0,4,2,3,6,7,100前4个数字控制菜单位置和大小,第4个“4”控制菜单离工具栏高度,第一个“1”控制是横向显示 色彩为下拉的背景色 if pNum=1 then response.write "stm_bp('p" & pNum & "',[1,4,0,4,2,3,6,7,100,'progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.43)',-2,'',-2,67,2,3,'#ffffff','#ffffff','',3,1,1,'#aca899']);" & vbcrlf '#EBEBEB菜单背景色 else if ShowType=0 then response.write "stm_bpx('p" & pNum & "','p" & pNum2 & "',[1,4,0,0,2,3,6]);" & vbcrlf else response.write "stm_bpx('p" & pNum & "','p" & pNum2 & "',[1,2,-2,-3,2,3,0]);" & vbcrlf end if end if k=0 sql="select ClassID,ClassName,Depth,NextID,LinkUrl,Child,Readme From zhi_rui_g_MenuClass" sql= sql & " where ParentID=" & ID & " order by OrderID asc" Set rs= Server.CreateObject("ADODB.Recordset") rs.open sql,conn,1,1 do while not rs.eof if rs(4)<>"" then if rs(5)>0 then response.write "stm_aix('p"&pNum&"i"&k&"','p"&pNum2&"i0',[0,'" & rs(1) & "','','',-1,-1,0,'" & rs(4) & "','_self','" & rs(4) & "','" & rs(6) & "','','',6,0,0,'images/arrow_r.gif','images/arrow_w.gif',7,7,0,0,1,'#FFFFFF',0,'#cccccc',0,'','',3,3,0,0,'#fffff7','#FFFFFF','#ffffff','#CCCCCC','9pt 宋体']);" & vbcrlf pNum=pNum+1 pNum2=pNum2+1 call GetClassMenu(rs(0),1) else response.write "stm_aix('p"&pNum&"i"&k&"','p"&pNum2&"i0',[0,'" & rs(1) & "','','',-1,-1,0,'" & rs(4) & "','_self','" & rs(4) & "','" & rs(6) & "','','',0,0,0,'','',0,0,0,0,1,'#FFFFFF',1,'#FFFFFF',0,'','',3,3,0,0,'#ffffff','#FFFFFF','#000000','#CCCCCC','9pt 宋体']);" & vbcrlf end if end if k=k+1 rs.movenext loop rs.close set rs=nothing response.write "stm_ep();" & vbcrlf end sub '************************************************** '函数名:Admin_ShowClass_Option '作 用:用作菜单管理 '参 数:ShowType ----显示类型 ' CurrentID -----当前ID ' Language -----语言 '************************************************** sub Admin_ShowClass_Option(ShowType,CurrentID,Language) if ShowType=0 then response.write "<option value='0'" if CurrentID=0 then response.write " selected" response.write ">无(作为一级栏目)</option>" end if dim rs,sql,strTemp,tmpDepth,i dim arrShowLine(20) for i=0 to ubound(arrShowLine) arrShowLine(i)=False next sql="Select * From zhi_rui_g_MenuClass order by RootID,OrderID" set rs=server.CreateObject("adodb.recordset") rs.open sql,conn,1,1 if rs.bof and rs.bof then response.write "<option value=''>请先添加栏目</option>" else do while not rs.eof tmpDepth=rs("Depth") if rs("NextID")>0 then arrShowLine(tmpDepth)=True else arrShowLine(tmpDepth)=False end if if ShowType=1 then if rs("LinkUrl")<>"" then strTemp="<option value=''" else strTemp="<option value='" & rs("ClassID") & "'" end if strTemp=strTemp & "style='background-color:#FFFFFF'" elseif ShowType=2 then if rs("LinkUrl")<>"" then strTemp="<option value=''" else strTemp="<option value='" & rs("ClassID") & "'" end if strTemp=strTemp & "style='background-color:#FFFFFF'" elseif ShowType=3 then if rs("Child")>0 then strTemp="<option value=''" elseif rs("LinkUrl")<>"" then strTemp="<option value='0'" else strTemp="<option value='" & rs("ClassID") & "'" end if strTemp=strTemp & "style='background-color:#FFFFFF'" elseif ShowType=4 then if rs("Child")>0 then strTemp="<option value=''" elseif rs("LinkUrl")<>"" then strTemp="<option value='0'" else strTemp="<option value='" & rs("ClassID") & "'" end if else strTemp="<option value='" & rs("ClassID") & "'" end if strTemp=strTemp & ">" if tmpDepth>0 then for i=1 to tmpDepth strTemp=strTemp & " " if i=tmpDepth then if rs("NextID")>0 then strTemp=strTemp & "├ " else strTemp=strTemp & "└ " end if else if arrShowLine(i)=True then strTemp=strTemp & "│" else strTemp=strTemp & " " end if end if next end if if Language=1 then strTemp=strTemp & rs("ClassNameEn") else strTemp=strTemp & rs("ClassName") end if if rs("LinkUrl")<>"" then strTemp=strTemp & "(外)" end if strTemp=strTemp & "</option>" response.write strTemp rs.movenext loop end if rs.close set rs=nothing end sub %>